def calculator():
    while True:
        num1 = float(input("请输入数字"))
        op = input("请输入运算符（+，-，*，/）")
        num2 = float(input("请输入数字"))

        if op == "+":
            result = num1 + num2
        elif op == "-":
            result = num1 - num2
        elif op == "*":
            result = num1 * num2
        elif op == "/":
            if num2 != 0:
                result = num1 / num2
            else:
                print("除数不能为0")
                continue
        print("结果为：",result)
        choose = input("是否继续计算(y/n)")
        if choose.lower() == "n":
            break

calculator()
